Typed set theory